@extends('layouts.default')
@section('main')
<div class="col-sm-2 col-xs-12 pull-left" id="sidebar" role="navigation">
</div>
<div class="col-sm-8 col-xs-12 pull-left">
    <div class="row">
        <!-- BEGIN CONTENT -->
       {{ Form::open(array('url'=>'store=tv','method'=>'post','class'=>'form-horizontal','id'=>'addform','role'=>'form')) }}
       {{ Form::token()}}
        <div class="panel panel-primary">
            <div class="panel-heading">
                <h4 class="panel-title">
                    <span class="glyphicon glyphicon-pencil"></span>
                    Thông Tin Thành Viên Đoàn Kiểm Tra
                </h4>
            </div>
            <div class="panel-collapse collapse in">
                <table class="table" cellspacing="0" cellpadding="0" style="margin-bottom: 0px">
                    <tr>
                        <td>
                            {{ Form::hidden('idct',$row->ID)}}
                            {{ Form::hidden('iddkt',$row->ID_DOAN_TT)}}
                            <!--Chọn cán bộ-->
                            <label for="idcb" class="col-sm-3 control-label">Cán bộ kiểm tra:</label>
                            <div class="col-sm-9">
                                    <select id="idcb" name='idcb' class="idcb form-control">
                                        @foreach($macbs as $macb)
                                            @if($macb != null)
                                            <option value='{{$macb->ID}}' @if($macb->ID == $row->ID_CB_TT) selected='selected' @endif>{{$macb->HO_TEN}}</option>
                                            @endif
                                        @endforeach
                                    </select>
                            </div>
                            <!--Kết thúc chọn cán bộ-->
                    </tr> 
                    <tr>
                        <td>
                            <!--Chọn chức vụ-->
                            <label for="idcv" class="col-sm-3 control-label">Chức vụ:</label>
                            <div class="col-sm-9">
                                    <select id="idcv" name='idcv' class="idcv form-control">
                                        @foreach($cvs as $cv)
                                        @if($cv != null)
                                        <option value='{{$cv->ID}}' @if($cv->ID == $row->ID_CV) selected='selected' @endif>{{$cv->TEN_CV}}</option>
                                        @endif
                                        @endforeach
                                    </select>
                            </div>
                            <!--Kết thúc chọn chức vụ-->
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <!--Chọn chức danh-->
                            <label for="idcd" class="col-sm-3 control-label">Chức danh:</label>
                            <div class="col-sm-9">
                                    <select id="idcd" name='idcd' class="idcd form-control">
                                        @foreach($cds as $cd)
                                        @if($cd != null)
                                        <option value='{{$cd->ID}}' @if($cd->ID == $row->ID_CHUC_DANH) selected='selected' @endif>{{$cd->TEN_CD}}</option>
                                        @endif
                                        @endforeach
                                    </select>
                            </div>
                            <!--Kết thúc chọn chức danh-->
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label for="tn" class="col-sm-3 control-label">Trách nhiệm thành viên:</label>
                            <div class="col-sm-9">
                                {{ Form::textarea('tn',$row->TRACH_NHIEM,array('rows' => '3','class'=>'tn form-control','autofocus')) }}
                            </div> 
                        </td>
                    </tr>
                    <tr>                      
                        <td>
                            <div class="col-sm-offset-4 col-sm-8"> 
                                <button class="btn btn-success" id='submitbtn' title="Lưu thông tin"><span class="glyphicon glyphicon-floppy-save">&nbsp;</span>Lưu</button>&nbsp;
                                <a class="btn btn-default" id="backcs_id" href="{{url('view=dsdoankt?id='.$row->ID_DOAN_TT)}}" title="Quay lại chi tiết đoàn kiểm tra"><span class="glyphicon glyphicon-arrow-left">&nbsp;</span>Quay lại</a>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        
        {{Form::close()}}   
        <!--Khi thay doi cho can bo-->

        @if(Session::has('success')) 
        <script type="text/javascript">
            toastr.success("{{Session::get('success')}}");
        </script>
        @endif
        @if(Session::has('error')) 
        <script type="text/javascript">
            toastr.error("{{Session::get('error')}}");
        </script>
        @endif
        <!-- END CONTENT -->
    </div>
</div><!--/span--> 
<!--/row-->
@stop